package threadLearn;

public class demon1 {
    public static void main(String[] args) {
        Thread thread=new Thread(()->{
            for (int i = 0; i < 3; i++) {
                System.out.println("这时线程thread");
            }
            System.out.println("thread线程结束");
        });
        System.out.println("mian线程开始等待");
        thread.start();
        try {
            thread.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("main线程等待结束");

    }

}
